package com.oJudge.judge.codeSandbox.Impl;

import com.oJudge.judge.codeSandbox.CodeSandbox;
import com.oJudge.judge.codeSandbox.modal.ExecuteCodeRequest;
import com.oJudge.judge.codeSandbox.modal.ExecuteCodeResponse;
import com.oJudge.judge.codeSandbox.modal.JudgeInfo;
import com.oJudge.model.enums.QuestionSubmiStatusEnum;

/**
 * 示例代码沙箱调用
 */
public class ExampleCodeSandbox implements CodeSandbox {
    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest request) {
        JudgeInfo judgeInfo = new JudgeInfo();
        judgeInfo.setMessage("测试代码沙箱");
        judgeInfo.setMemory(100L);
        judgeInfo.setTime(100L);

        ExecuteCodeResponse response = ExecuteCodeResponse.builder()
                .inputList(request.getInputList())
                .message("设置代码成功")
                .status(QuestionSubmiStatusEnum.SUCCEED.getValue())
                .judgeInfo(judgeInfo)
                .build();
        return response;
    }
}
